home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ für Kids
/
C++ for kids.iso
/
Buch
/
WegDa.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1999-01-04
|
1KB
|
58 lines
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "WegDa.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
const int Farbe = 16777215;
bool Modus1, Modus2;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Modus2 = !Modus2;
Color = random (Farbe);
if (Modus2)
{
Button2->Show();
Button1->Caption = "Hide";
}
else
{
Button2->Hide();
Button1->Caption = "Show";
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Modus1 = !Modus1;
Color = random (Farbe);
if (Modus1)
{
Button1->Show();
Button2->Caption = "Hide";
}
else
{
Button1->Hide();
Button2->Caption = "Show";
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
randomize ();
Color = random (Farbe);
Modus1 = true;
Modus2 = false;
}
//---------------------------------------------------------------------------